home *** CD-ROM | disk | FTP | other *** search
- Script BatBall; (* Bat & Ball Script V.1.00 by Michael Spalter *)
- VAR
- xpos : INTEGER; ypos : INTEGER;
- xinc : INTEGER; yinc : INTEGER;
- Col : INTEGER; Bat : STRING[12];
- BatP : INTEGER; Key : INTEGER;
- OldX : INTEGER; OldY : INTEGER;
- Score : INTEGER; work : INTEGER;
- Dead : BOOLEAN;
-
- BEGIN
-
- (* Draw main screen *)
-
- BackGnd(Black);
- ClrScr;
- GotoXY(1,1); BackGnd(Black); ForeGnd(Lgreen);
- Write("∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞");
- Write("∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞");
- FOR Col:=1 TO 22 DO
- GotoXY(1,Col); Write("∞"); GotoXY(78,Col); Write("∞");
- END;
- ForeGnd(Yellow);
- GotoXY(2,0); Write(" Bat & Ball ! SCORE: 0000 ");
-
- (* Set intital values of variables *)
-
- Xpos:=5; YPos:=8; Xinc:=1; Yinc:=-1;
- Col:=13; BatP:=38; Bat:=' flflflflflfl ';
- Score:=0; Dead:=FALSE; Cursor(False);
-
- REPEAT
- GotoXY(OldX,OldY); Write(" ");
- INC(Xpos,Xinc);
- INC(YPos,Yinc);
-
- REPEAT Key:=RdKey; UNTIL NOT KEYPRESSED;
-
- IF Key=331 THEN DEC(BatP,3); END;
- IF Key=333 THEN INC(BatP,3); END;
- IF BatP<0 THEN Batp:=0; END;
- IF BatP>68 THEN Batp:=68; END;
-
- GotoXY(OldX,OldY); Write(" ");
-
- GotoXY(BatP,23); ForeGnd(LCyan); Write(Bat);
- IF Xpos>75 THEN Xinc:=-((ScriptTime MOD 2)+1); Alarm(1); END;
- IF Xpos<3 THEN Xinc:=1; Alarm(1); END;
- IF Ypos=2 THEN Yinc:=1; Alarm(1); END;
- ForeGnd(Yellow);
- IF Ypos=22 THEN
- IF (BatP<Xpos) AND (Xpos<(BatP+9)) THEN
- Yinc:=-1; INC(Score); Alarm(1);
- GotoXY(26,0); Write(Score*1000);
- ELSE Dead:=TRUE;
- END;
- END;
-
- ForeGnd(Col); BackGnd(Black);
- GotoXY(XPos,YPos); Write('€€');
- OldX:=Xpos; OldY:=Ypos;
- TDelay(2);
- UNTIL Dead;
- Alarm(4);
- GotoXY(25,12); WrLn(' YOU ARE DEAD !!!!!! SCORE: ',Score*1000);
- Cursor(TRUE);
-
- END BatBall.
-